David Feinberg
Who:
Where:
print("Hello, world!")
a = 1
b = 2
c = a + b
print(c)
import math
math.sqrt(81)
import statistics
x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print("Mean of x: ", statistics.mean(x))
print("Standard deviation of x: ", statistics.stdev(x))
print("Variance of x: ", statistics.variance(x))
from scipy.stats.stats import pearsonr
a = [1, 4, 6, 8, 10, 12]
b = [1, 2, 3, 4, 5, 2]
r, p = pearsonr(a,b)
print("The correlation coefficient between a & b is r = {}".format(r))
print("The p-value of that correlation is p = {}".format(p))
if p < 0.05:
print("The correlation is significant at p < 0.5")
elif p > 0.05:
print("The correlation is not significant at p < 0.5")
import matplotlib
import matplotlib.pyplot as plt
plt.scatter(a, b)
plt.show()
import youtube_dl
import pandas as pd
song_list = [
'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
]
ydl_opts = {
'format': 'best',
'outtmpl': 'my_favourite_song.webm'
}
for song in song_list:
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([song])
import io
import base64
from IPython.display import HTML
video = io.open('my_favourite_song.webm', 'r+b').read()
encoded = base64.b64encode(video)
HTML(data='''<video alt="test" controls>
<source src="data:video/webm;base64,{0}" type="video/webm" />
</video>'''.format(encoded.decode('ascii')))